package edu.stanford.hardon.Tabs;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import edu.stanford.hardon.DatabaseHelper;
import edu.stanford.hardon.TravelHarder;
import android.content.Context;
import android.location.Location;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;

public abstract class GenericTab {
	protected int			mId;
	protected String		mText;
	protected int 			mIconResourceId;
	protected LinearLayout 	tabLayout;
	protected TravelHarder    th;
	
	GenericTab( int Id, String Text, int iconResourceId, LinearLayout layout, TravelHarder th )
	{
		mId = Id;
		mIconResourceId = iconResourceId;
		mText = Text;
		tabLayout = layout;
		this.th = th;
	}
	
	public int getId( )
	{
		return mId;
	}
	
	public String getText( )
	{
		return mText;
	}
	
	public int getIconResourceId( )
	{
		return mIconResourceId;
	}
	    
	public void setText( String Text )
	{
		mText = Text;
	}
	
	public void setIconResourceId( int iconResourceId )
	{
		mIconResourceId = iconResourceId;
	}
	
	public void showTab(){
		if(tabLayout.getVisibility() == View.GONE){
			tabLayout.setVisibility(View.VISIBLE);
			startTab();
		}
	}
	
	public void hideTab(){
		if(tabLayout.getVisibility() == View.VISIBLE){
			tabLayout.setVisibility(View.GONE);
			stopTab();
		}
	}
	
	
	protected abstract void startTab();
	
	public abstract void setPaused();
	public abstract void setResumed();
	
	protected abstract void stopTab();
	
	public boolean onBackButtonDown(){
		return false;
	}
	
}
